//
//  AttendanceInfo.m
//  RSW.IOS
//
//  Created by zhaiqiuqiu on 17/1/3.
//  Copyright © 2017年 com.xtion.crm. All rights reserved.
//

#import "AttendanceInfo.h"

static XMSQueueDictionary *s_jsonPair;

@implementation AttendanceInfo

-(NSMutableDictionary*)expandfields
{
    if(_expandfields == nil)
        _expandfields = [NSMutableDictionary new];
    return _expandfields;
}

+ (void)initialize
{
    if(s_jsonPair == nil)
    {
        XMSQueueDictionary *qd = [[XMSQueueDictionary alloc]initWithStoreClass:[CDBColPropertyPair class]];
        [qd addKey:@"ID" value:@"attendanceId"];
        [qd addKey:@"TypeId" value:@"typeId"];
        [qd addKey:@"Content" value:@"content"];
        [qd addKey:@"Address" value:@"address"];
        [qd addKey:@"Longitude" value:@"longitude"];
        [qd addKey:@"Latitude" value:@"latitude"];
        [qd addKey:@"Isinside" value:@"isinside"];
        [qd addKey:@"Images" value:@"images"];
        
        s_jsonPair = [CTransformHTTPRESTObj registerJSONObjectClass:[WorkSummaryInfo class] JSONKeyPair:qd];
    }
}

+ (XMSQueueDictionary *)JSONObjectProperty:(NSArray *)JSONKeys
{
    return [CTransformHTTPRESTObj JSONObjectMap:s_jsonPair propertyWithJSONKey:JSONKeys];
}

+(AttendanceInfo*)emptyAttendanceInfo
{
    AttendanceInfo *model = [AttendanceInfo new];
    
    model.attendanceId = @"";
    model.typeId = @"";
    model.content = @"";
    model.address = @"";
    model.latitude = [XMSNumberDouble numberDoubleWithDoubleValue:0];
    model.longitude = [XMSNumberDouble numberDoubleWithDoubleValue:0];
    model.isinside = [XMSNumberInt numberIntWithIntValue:0];
    model.images = [NSMutableArray new];
    
    model.expandfields = [NSMutableDictionary new];
    
    return model;
}

@end
